import bus from '@/bus'
let date = new Date()
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    distributorIds: [],
    officeId: '',
    depId: '',
    brandId: '',
    identifyStatus: '',
    yearmonth: date.getFullYear() + '-' + (date.getMonth() + 1),
    isAuth: null,
    salesmanName: '',
    phoneNo: ''
  },
  columns: [{
      title: '科室',
      key: 'officeName',
      align: 'left',
      minWidth: 120
    }, {
      title: '地区',
      key: 'depName',
      align: 'left',
      minWidth: 200
    }, {
      title: '经销商',
      key: 'distributorName',
      align: 'left',
      minWidth: 200,
      tooltip: true
    }, {
      title: '业务员姓名',
      key: 'salesmanName',
      align: 'left',
      minWidth: 150
    }, {
      title: '业务员手机',
      key: 'phoneNo',
      align: 'left',
      minWidth: 150
    }, {
      title: '认证天数',
      key: 'identifyDays',
      align: 'right',
      minWidth: 100
    }, {
      title: '认证品牌',
      key: 'brandName',
      align: 'left',
      minWidth: 150
    }, {
      title: '认证职能',
      key: 'functionType',
      align: 'left',
      minWidth: 150,
      render: (h, params) => {
        const row = params.row
        if (row.functionType == 'BOSS') {
          return h('div', '老板')
        } else if (row.functionType == 'MANAGER') {
          return h('div', '经销商经理')
        } else if (row.functionType == 'SALESMAN') {
          return h('div', '经销商业务员')
        } else if (row.functionType == 'BACK_OFFICE') {
          return h('div', '经销商内勤')
        } else {
          return h('div', '-')
        }
      }
    }, {
      title: '活跃门店数',
      key: 'activeStoreCount',
      align: 'right',
      minWidth: 120
    }, {
      title: '实际抢购数',
      key: 'actualPanicBuyQuantity',
      align: 'right',
      minWidth: 120
    }, {
      title: '匹配入库数',
      key: 'scanInQuantity',
      align: 'right',
      minWidth: 120
    }, {
      title: '当前状态',
      key: 'identifyStatus',
      align: 'left',
      minWidth: 150,
      render: (h, params) => {
        const row = params.row
        if (row.identifyStatus == 'CERTIFICATION_REVIEW') {
          return h('div', '认证审核中')
        } else if (row.identifyStatus == 'NOT_CERTIFIED') {
          return h('div', '未认证')
        } else if (row.identifyStatus == 'UNVERIFIED') {
          return h('div', '未验证')
        } else if (row.identifyStatus == 'VERIFIED') {
          return h('div', '已验证')
        } else {
          return h('div', '-')
        }
      }
    }, {
      title: '验证时间',
      key: 'lastIdentifyDate',
      align: 'left',
      minWidth: 200,
      render: (h, p) => {
        return <div>{p.row.lastIdentifyDate || '-'}</div>
      }
    }, {
      title: '维护门店数',
      key: 'storeNum',
      align: 'right',
      minWidth: 150
    }, {  
      title: '需要认证',
      key: 'isAuth',
      align: 'left',
      minWidth: 100,
      render: (h, params) => {
        const row = params.row
        if(row.isAuth == true){
          return h('div', '是')
        }else{
          return h('div', '否')
        }
      }
    }, {
      title: '操作',
      key: 'gender',
      align: 'right',
      minWidth: 200,
      fixed: 'right',
      render: (h, params) => {
        const row = params.row
        return h('div', [
          h('Button', {
            props: {
              type: 'primary',
              size: 'small'
            },
            style:{
              'margin-right': '5px'
            },
            on: {
              click: () => {
                  bus.$emit('onEdit',params.row)
              }
            }
          }, row.identifyStatus == 'CERTIFICATION_REVIEW' ? '认证审核' : '认证编辑'),
          h('Button', {
            props: {
              size: 'small'
            },
            on: {
              click: () => {
                  bus.$emit('onApprove',params.row)
              }
            }
          }, row.isAuth == true ? '解除认证' : '设为需认证')
        ])
      }
    }],
  data: []
}
export default data